package com.ruoyi.business.mapper;

import java.util.List;
import com.ruoyi.business.domain.JtOrder;
import com.ruoyi.business.domain.JtOrderItem;
import org.apache.ibatis.annotations.Param;

/**
 * 订单Mapper接口
 * 
 * @author Alan Zhang
 * @date 2025-03-29
 */
public interface JtOrderMapper 
{
    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单 明细
     */
    public JtOrder selectJtOrderByOrderId(Long orderId);

    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    public JtOrder selectOrderInfoByOrderId(Long orderId);

    /**
     * 查询订单
     *
     * @param orderNo 订单号
     * @return 订单
     */
    public JtOrder selectJtOrderByOrderNo(String orderNo);


    /**
     * 查询订单列表
     * 
     * @param jtOrder 订单
     * @return 订单集合
     */
    public List<JtOrder> selectJtOrderList(JtOrder jtOrder);

    /**
     * 查询订单列表
     *
     * @param jtOrder 订单
     * @return 订单集合
     */
    public List<JtOrder> selectJtOrderAndItemList(JtOrder jtOrder);

    /**
     * 新增订单
     * 
     * @param jtOrder 订单
     * @return 结果
     */
    public int insertJtOrder(JtOrder jtOrder);

    /**
     * 修改订单
     * 
     * @param jtOrder 订单
     * @return 结果
     */
    public int updateJtOrder(JtOrder jtOrder);

    /**
     * 删除订单
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteJtOrderByOrderId(Long orderId);

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJtOrderByOrderIds(String[] orderIds);

    /**
     * 批量删除订单明细
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteJtOrderItemByOrderIds(String[] orderIds);
    
    /**
     * 批量新增订单明细
     * 
     * @param jtOrderItemList 订单明细列表
     * @return 结果
     */
    public int batchJtOrderItem(List<JtOrderItem> jtOrderItemList);
    

    /**
     * 通过订单主键删除订单明细信息
     * 
     * @param orderId 订单ID
     * @return 结果
     */
    public int deleteJtOrderItemByOrderId(Long orderId);

    /**
     * 统计订单数
     * @param startDate
     * @param endDate
     * @return
     */
    public Long selectOrderCount(@Param("beginCreateTime") String startDate, @Param("endCreateTime") String endDate);
}
